﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DZPK
{
    class CommandHelper
    {
        public static string IntCmdToString(int cmd)
        {
            string ret = string.Empty;

            switch (cmd)
            {
                case 16416:
                    ret = "SERVER_COMMAND_VOTEKICKUSER";
                    break;
                case 4098:
                    ret = "CLIENT_COMMAND_LOGOUT";
                    break;
                case 16391:
                    ret = "SERVER_BROADCAST_USER_STAND";
                    break;
                case 16408:
                    ret = "SERVER_COMMAND_USER_KICK";
                    break;
                case 16406:
                    ret = "SERVER_COMMAND_USER_FROMTOALLCHIPS";
                    break;
                case 16426:
                    ret = "SERVER_COMMAND_SNGUSERSTANDINFO";
                    break;
                case 16407:
                    ret = "SERVER_COMMAND_USER_NOTICEALL";
                    break;
                case 16429:
                    ret = "SERVER_COMMAND_SNGALLLOGIN_SUCCESS";
                    break;
                case 28673:
                    ret = "SERVER_DETECT_CONN";
                    break;
                case 16431:
                    ret = "SERVER_COMMAND_USERLOGIN";
                    break;
                case 4109:
                    ret = "CLIENT_COMMAND_USER_VOTEKICKUSER";
                    break;
                case 16397:
                    ret = "SERVER_COMMAND_DEAL_RIVER";
                    break;
                case 16441:
                    ret = "SERVER_COMMAND_MTTSNGUSEROVERINFO";
                    break;
                case 0x0101:
                    ret = "CLIENT_COMMAND_CONNECTSUCCEED";
                    break;
                case 4104:
                    ret = "CLIENT_COMMAND_USER_FROMTOALLCHIPS";
                    break;
                case 16449:
                    ret = "SERVER_AND_CLIENT_MAX_COMMAND";
                    break;
                case 4106:
                    ret = "CLIENT_COMMAND_USER_STAND";
                    break;
                case 16428:
                    ret = "SERVER_COMMAND_SNGUSERRANKINFO";
                    break;
                case 16413:
                    ret = "SERVER_COMMAND_LOGINOUT_SUCCESS";
                    break;
                case 12289:
                    ret = "SERVER_USERCHIPIN_ERR";
                    break;
                case 4101:
                    ret = "CLIENT_COMMAND_CHIPIN";
                    break;
                case 4108:
                    ret = "CLIENT_COMMAND_USER_ADDFRIEND_SUCCESS";
                    break;
                case 16398:
                    ret = "SERVER_COMMAND_START_CHIPIN";
                    break;
                case 4113:
                    ret = "CLIENT_COMMAND_LOTTERYBUY";
                    break;
                case 16432:
                    ret = "SERVER_COMMAND_USERLOGOUT";
                    break;
                case 4116:
                    ret = "CLIENT_COMMAND_CONTINUE";
                    break;
                case 4117:
                    ret = "CLIENT_COMMAND_UPDATE_USER_INFO";
                    break;
                case 16403:
                    ret = "SERVER_COMMAND_USER_CHAT";
                    break;
                case 16386:
                    ret = "SERVER_COMMAND_LOGIN_ERR";
                    break;
                case 16422:
                    ret = "SERVER_COMMAND_VENUECOSTS";
                    break;
                case 16401:
                    ret = "SERVER_COMMAND_FINAL_GAME";
                    break;
                case 20481:
                    ret = "SERVER_COMMAND_USER_CHANGE_SERVER";
                    break;
                case 16394:
                    ret = "SERVER_COMMAND_DEAL_PREFLOP";
                    break;
                case 0x4040:
                    ret = "SERVER_COMMAND_STANDTIMING";
                    break;
                case 4107:
                    ret = "CLIENT_COMMAND_USER_ADDFRIEND";
                    break;
                case 12290:
                    ret = "SERVER_COMMAND_PACKETVERERR";
                    break;
                case 16439:
                    ret = "SERVER_COMMAND_MTTSNGRANKDATA";
                    break;
                case 28674:
                    ret = "CLIENT_ECHO_CONN";
                    break;
                case 8193:
                    ret = "CLIENT_CMD_CONNECT_GAMESERVER_S";
                    break;
                case 16437:
                    ret = "SERVER_COMMAND_USERUPDATAEXP";
                    break;
                case 16438:
                    ret = "SERVER_COMMAND_SHOWDEALPREFLOPCARD";
                    break;
                case 16410:
                    ret = "SERVER_COMMAND_SYSMSG";
                    break;
                case 4110:
                    ret = "CLIENT_COMMAND_USER_KICKUSER_REQUEST";
                    break;
                case 16409:
                    ret = "SERVER_COMMAND_TABLECHATHISTORY";
                    break;
                case 16420:
                    ret = "SERVER_COMMAND_STOPSERVER";
                    break;
                case 16427:
                    ret = "SERVER_COMMAND_SNGTALBESTATE";
                    break;
                case 16404:
                    ret = "SERVER_COMMAND_BIND_SUCCESS";
                    break;
                case 4118:
                    ret = "CLIENT_COMMAND_CHANGE_SERVER_USER_LOGIN";
                    break;
                case 258:
                    ret = "CLIENT_COMMAND_CONNECTFAILED";
                    break;
                case 0x1010:
                    ret = "CLIENT_COMMAND_SNGTABLEINFO";
                    break;
                case 16412:
                    ret = "SERVER_COMMAND_SYSTOOTHER";
                    break;
                case 16445:
                    ret = "SERVER_COMMAND_MTTFINAL";
                    break;
                case 4111:
                    ret = "CLIENT_COMMAND_USER_SMALLFEES";
                    break;
                case 4114:
                    ret = "CLIENT_COMMAND_SHOWDEALPREFLOPCARD";
                    break;
                case 16417:
                    ret = "SERVER_COMMAND_USER_KICKUSER_RESPONSE";
                    break;
                case 16396:
                    ret = "SERVER_COMMAND_DEAL_TURN";
                    break;
                case 4099:
                    ret = "CLIENT_COMMAND_SIT_REQUEST";
                    break;
                case 16433:
                    ret = "SERVER_COMMAND_SNGTIMESMALLBLIN";
                    break;
                case 16446:
                    ret = "SERVER_COMMAND_GLODRUSHCHANGEROOM";
                    break;
                case 2049:
                    ret = "CLIENT_CMD_CONNECT_GAMESERVER";
                    break;
                case 8195:
                    ret = "SERVER_CMD_CONNECT_GAMESERVER_FAILED_S";
                    break;
                case 16405:
                    ret = "SERVER_COMMAND_USER_FROMTOCHIPS";
                    break;
                case 16415:
                    ret = "SERVER_COMMAND_USER_ADDFRIEND_SUCCESS";
                    break;
                case 16390:
                    ret = "SERVER_BROADCAST_USER_SIT";
                    break;
                case 16434:
                    ret = "SERVER_COMMAND_LOTTERYBUY";
                    break;
                case 16436:
                    ret = "SERVER_COMMAND_SYSKICKUSER";
                    break;
                case 4105:
                    ret = "CLIENT_COMMAND_USER_NOTICEALL";
                    break;
                case 16451:
                    ret = "SERVER_COMMAND_RANK_ONE_NOTICE";
                    break;
                case 16387:
                    ret = "SERVER_COMMAND_LOGIN_SUCCESS";
                    break;
                case 16389:
                    ret = "SERVER_COMMAND_SIT_FAILED";
                    break;
                case 2306:
                    ret = "SERVER_CMD_CONNECT_GAMESERVER_FAILED";
                    break;
                case 16402:
                    ret = "SERVER_COMMAND_SHOW_PREFLOP";
                    break;
                case 16414:
                    ret = "SERVER_COMMAND_USER_ADDFRIEND";
                    break;
                case 16444:
                    ret = "SERVER_COMMAND_CHANGESERVER";
                    break;
                case 4100:
                    ret = "CLIENT_COMMAND_TABLEINFO_REQUEST";
                    break;
                case 16395:
                    ret = "SERVER_COMMAND_DEAL_FLOP";
                    break;
                case 4103:
                    ret = "CLIENT_COMMAND_USER_FROMTOCHIPS";
                    break;
                case 16399:
                    ret = "SERVER_COMMAND_USER_ACTION";
                    break;
                case 16424:
                    ret = "SERVER_COMMAND_SNGBIND_SUCCESS";
                    break;
                case 16430:
                    ret = "SERVER_COMMAND_SNGALLBIND_SUCCESS";
                    break;
                case 16435:
                    ret = "SERVER_COMMAND_LOTTERYMONEY";
                    break;
                case 16423:
                    ret = "SERVER_COMMAND_SNGLOGIN_SUCCESS";
                    break;
                case 16400:
                    ret = "SERVER_COMMAND_FINAL_ROUND";
                    break;
                case 16388:
                    ret = "SERVER_COMMAND_SIT_SUCCESS";
                    break;
                case 16385:
                    ret = "SERVER_COMMAND_USER_NOT_FOUND";
                    break;
                case 16418:
                    ret = "SERVER_COMMAND_VOTEEND";
                    break;
                case 16393:
                    ret = "SERVER_BROADCAST_GAME_START";
                    break;
                case 16419:
                    ret = "SERVER_COMMAND_KICKUSER_RESPONSE";
                    break;
                case 2305:
                    ret = "SERVER_CMD_CONNECT_GAMESERVER_SUCCESS";
                    break;
                case 16421:
                    ret = "SERVER_COMMAND_USER_SMALLFEES";
                    break;
                case 4097:
                    ret = "CLIENT_COMMAND_LOGIN";
                    break;
                case 8194:
                    ret = "SERVER_CMD_CONNECT_GAMESERVER_SUCCESS_S";
                    break;
                case 4102:
                    ret = "CLIENT_COMMAND_USER_CHAT";
                    break;
                case 16443:
                    ret = "SERVER_COMMAND_MTTSNGTIMESTART";
                    break;
                case 16411:
                    ret = "SERVER_COMMAND_SYSTOUSERCHIPS";
                    break;
                case 16392:
                    ret = "SERVER_COMMAND_TABLEINFO_RESPONSE";
                    break;
                case 16440:
                    ret = "SERVER_COMMAND_MTTSNGUSERRANKINFO";
                    break;
                case 16425:
                    ret = "SERVER_BROADCAST_SNGGAME_START";
                    break;
                case 16442:
                    ret = "SERVER_COMMAND_MTTSNGCHANGETABLE";
                    break;
                case 4115:
                    ret = "CLIENT_COMMAND_MTTSNGRANKDATA";
                    break;
                case 4119:
                    ret = "CLIENT_COMMAND_ROOMINFO_REQUEST";
                    break;
                case 16452:
                    ret = "SERVER_COMMAND_ROOMINFO_RESPONSE";
                    break;
                case 16453:
                    ret = "SERVER_COMMAND_PLAYERINFO_RESPONSE";
                    break;
                default:
                    //throw new Exception("command not know!");
                    ret = string.Format("unknow cmd {0}", cmd);
                    break;
            }

            return ret;
        }

        public static string IntOptionToString(int option)
        {
            string ret = string.Empty;

            switch (option)
            {
                case CardOption.CHIPIN_FOLD:
                    ret = "CHIPIN_FOLD";
                    break;
                case CardOption.CHIPIN_CHECK:
                    ret = "CHIPIN_CHECK";
                    break;
                case CardOption.CHIPIN_CALL:
                    ret = "CHIPIN_CALL";
                    break;
                case CardOption.CHIPIN_RAISE:
                    ret = "CHIPIN_RAISE";
                    break;
                case CardOption.CHIPIN_SMALLBLIND:
                    ret = "CHIPIN_SMALLBLIND";
                    break;
                case CardOption.CHIPIN_BIGBLIND:
                    ret = "CHIPIN_BIGBLIND";
                    break;
                case CardOption.CHIPIN_ALL_IN:
                    ret = "CHIPIN_ALL_IN";
                    break;
                default:
                    ret = string.Format("unknow action {0}", option);
                    break;
            }

            return ret;
        }
    }
}
